package org.vacuela.attendance;

import javax.persistence.Entity;

import com.u2d.app.User;
import com.u2d.list.RelationalList;
import com.u2d.model.AbstractComplexEObject;
import com.u2d.model.Title;
import com.u2d.type.atom.StringEO;

@Entity
public class Company extends AbstractComplexEObject {
	private final StringEO _name = new StringEO();
	private final StringEO address = new StringEO();
	private final StringEO principal = new StringEO();
	private final StringEO city = new StringEO();
	private final StringEO phone = new StringEO();
	
	private final RelationalList divisions = new RelationalList(Division.class);
	public static final Class divisionsType = Division.class;
	public static String divisionsInverseFieldName = "company";

	private final RelationalList categories = new RelationalList(Category.class);	
	public static final Class categoriesType = Category.class;
	public static String categoriesInverseFieldName = "company";
	
	private final RelationalList employees = new RelationalList(User.class);	
	public RelationalList getEmployees() {
		return employees;
	}

	public static final Class employeesType = User.class;
	
	public static String[] identities = { "name" };
	public static final String[] fieldOrder = { "name", "principal", "address","city","phone","divisions","categories" };

	public RelationalList getDivisions() {
		return divisions;
	}

	public RelationalList getCategories() {
		return categories;
	}
	
	public Company() {
	}

	public StringEO getName() {
		return _name;
	}

	public StringEO getAddress() {
		return address;
	}

	public StringEO getPrincipal() {
		return principal;
	}

	public StringEO getCity() {
		return city;
	}

	public StringEO getPhone() {
		return phone;
	}

	public Title title() {
		return _name.title();
	}

}
